//
//  KZWaveRecordingView.m
//  听说弱点强化训练
//
//  Created by 朱凯 on 2018/8/30.
//  Copyright © 2018年 盛超. All rights reserved.
//

#import "KZWaveRecordingView.h"

#import "TYWaveProgressView.h"

@implementation KZWaveRecordingView
{
    TYWaveProgressView *_waveProgressView;
}

- (instancetype)init {
    
    if (self = [super init]) {
        
    }
    return self;
}
- (void)layoutSubviews {
    
    [super layoutSubviews];
    [self setupUI];
}
- (void)setupUI {
    
    _waveProgressView = [[TYWaveProgressView alloc]initWithFrame:self.bounds];
    _waveProgressView.waveViewMargin = UIEdgeInsetsMake(0, 0, 0, 0);
    _waveProgressView.backgroundImageView.image = [UIImage imageNamed:@"kz-话咪背景"];
    _waveProgressView.numberLabel.text = @"";
    _waveProgressView.numberLabel.font = [UIFont boldSystemFontOfSize:70];
    _waveProgressView.numberLabel.textColor = [UIColor whiteColor];
    _waveProgressView.unitLabel.text = @"";
    _waveProgressView.unitLabel.font = [UIFont boldSystemFontOfSize:20];
    _waveProgressView.unitLabel.textColor = [UIColor whiteColor];
    _waveProgressView.explainLabel.text = @"";
    _waveProgressView.explainLabel.font = [UIFont systemFontOfSize:20];
    _waveProgressView.explainLabel.textColor = [UIColor whiteColor];
    
    _waveProgressView.percent = 0.3;
    [self addSubview:_waveProgressView];
    [_waveProgressView startWave];
    
    
    UIImageView *huamiView = [UIImageView new];
    huamiView.image = [UIImage imageNamed:@"kz-话咪"];
    [self addSubview:huamiView];
    [huamiView sizeToFit];
    huamiView.center = CGPointMake(self.width / 2, self.height / 2);
    
}

- (void)pauseSource {
    [_waveProgressView stopWave];
}
- (void)beginSource {
    [_waveProgressView startWave];
}

@end
